<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>课程管理|<{$configcache['Title']}></title>
    <link rel="stylesheet" type="text/css" href="__CSS__/content.css"  />
    <link rel="stylesheet" type="text/css" href="__CSS__/public.css"  />
    <script type="text/javascript" src="__JS__/jquery.js"></script>
    <script type="text/javascript" src="__JS__/Public.js"></script>
    <script type="text/javascript" src="__JS__/winpop.js"></script>
    <script type="text/javascript" src="__JS__/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="__JS__/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="__JS__/layer/skin/layer.css" />
    <style type="text/css">
        .select{padding:5px 10px;border:#ddd 1px solid;border-radius:4px;width:60%;margin:5% auto;font-size:12px}
        .select li{list-style:none;padding:10px 0 5px 100px}
        .select .select-list{border-bottom:#eee 1px dashed}
        .select dl{zoom:1;position:relative;line-height:24px;}
        .select dl:after{content:" ";display:block;clear:both;height:0;overflow:hidden}
        .select dt{width:100px;margin-bottom:5px;position:absolute;top:0;left:-100px;text-align:right;color:#666;height:24px;line-height:24px}
        .select dd{float:left;display:inline;margin:0 0 5px 5px;}
        .select a{display:inline-block;white-space:nowrap;height:24px;padding:0 10px;text-decoration:none;color:#039;border-radius:2px;}
        .select a:hover{color:#f60;background-color:#f3edc2}
        .select .selected a{color:#fff;background-color:#f60}
        .select-result dt{font-weight:bold}
        .select-no{color:#999}
        .select .select-result a{padding-right:20px;background:#f60 url("__PUBLIC__/image/close.gif") right 9px no-repeat}
        .select .select-result a:hover{background-position:right -15px}
        .tc{text-align:center; text-indent:0;font-family:"微软雅黑";font-size: 14px;color:#111;}
        .fixed_w { width:100px; }
        .fixed_w .oper { padding:0px 6px; color:#060; }
    </style>
    <style type="text/css">
        #content .text1 {
            width: 120px;
            height: 26px;
            line-height: 26px;
            color: #555;
            font-family: "微软雅黑";
            background: url(__PUBLIC__/image/home/textbg.jpg) repeat-x left top;
            border: solid 1px #ccc;
        }
        #content .so1 {
            width: 60px;
            height: 28px;
            line-height: 28px;
            border: none;
            background: #090;
            color: #fff;
            font-family: "微软雅黑";
        }
        #content h2 .search1 {
            width: auto;
            height: 40px;
            right: 340px;
            float: right;
        }
    </style>
</head>
<body>
    <div id="content">
        <h1>首页 > 课程管理 > 课程列表</h1>
        <h2 style="width: 99%;">
            <div class="h2_left">
                <a href="__ACTION__" class="whole">全部</a>
                <a href="javascript:;" class="f5" onclick="f5();">刷新</a>
                <a href="javascript:history.back();" class="Retreat">后退</a>
                <a href="javascript:history.go(1);" class="Advance">前进</a>
            </div>
        </h2>
        <div class="fen" style="width: 99%">
            <ul class="select" style="height:auto;margin-top: 20px;margin-bottom: 20px;">
                <li class="select-list List_more">
                    <dl id="select">
                        <dt>课程状态：</dt>
                        <volist name="status" id="val">
                            <dd <if condition="$Think.get.s eq $val['value']"> class="selected select-all"</if>><a href="<{$val.value|createsearchurl="/Courses/index",s,###,"add",null,null}>"><{$val.name}></a></dd>
                        </volist>
                    </dl>
                </li>
				 <li class="select-list List_more">
                    <dl id="select">
                        <dt>推荐状态：</dt>
                        <volist name="site" id="val">
                            <dd <if condition="$Think.get.site eq $val['value']"> class="selected select-all"</if>><a href="<{$val.value|createsearchurl="/Courses/index",site,###,"add",null,null}>"><{$val.name}></a></dd>
                        </volist>
                    </dl>
                </li>
                <li class="select-list List_more">
                    <dl id="select">
                        <dt>课程名称：</dt>
                        <form method="get" id="search" >
                            <input type="text" name="courseName" class="text1" value="<{$courseName}>"/>
                            <input type="submit" class="so1" value="搜 索" />
                        </form>
                    </dl>
                </li>
            </ul>

        </div>
        <table id="table" border="1" bordercolor="#CCCCCC" cellpadding="0" cellspacing="0">
            <tr>
                <th>主图</th>
                <th>课程名称</th>
                <th>课时数量</th>
                <th>学习对象</th>
                <th>行业类别</th>
                <th>价格</th>
                <th>是否推荐</th>
                <th>认证状态</th>
                <th>操作</th>
            </tr>
            <volist name="list" id="vo">
                <tr>
                    <td style="text-align:center" class='tc'><img src="<{$vo.mainCoursePicUrl}>" style="padding: 5px; width: 100px;height: 50px;"></td>
                    <td style="text-align:center" class='tc'><{$vo.courseName}></td>
                    <td style="text-align:center" class='tc'><{$vo.courseNum}></td>
                    <td style="text-align:center" class='tc'><{$vo.studyObejct}></td>
                    <td style="text-align:center" class='tc'><{$vo.courseCategroy}></td>
                    <td style="text-align:center" class='tc'><{$vo.coursePrice}>元 </td>
                    <td style="text-align:center" class='tc  fixed_w'  >
                        <switch name="vo.courseSite">
                            <case value="0">未推荐
                             <a href="javascript:;" class="tophome" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>推荐</a>&nbsp;&nbsp;<a href="javascript:;" class="notophome" status = '0' style="color:#FF9933" sid='<{$vo.sid}>'>取消</a>
                            </case>
                            <case value="1">已推荐
                             <a href="javascript:;" class="tophome" status = '1' style="color:#FF9933" sid='<{$vo.sid}>'>推荐</a>&nbsp;&nbsp;<a href="javascript:;" class="notophome" status = '0' style="color:#FF9933" sid='<{$vo.sid}>'>取消</a>
                            </case></case>
                            <default/>
                        </switch>
                         
                    </td>
                    <td style="text-align:center" class='tc'>
                        <switch name="vo.checkStatus">
                            <case value="0">未审核</case>
                            <case value="1">待审核</case>
                            <case value="2">已审核</case>
                            <default/>
                        </switch>
                    </td>

                    <td class="tc fixed_w">
                        <a href="__APP__/Courses/CourseInfo/sid/<{$vo.sid}>" class="edit oper">详情</a>
                        <switch name="vo.checkStatus">
                            <case value="0">
                                <a href="#" class="pass" sid='<{$vo.sid}>' style="color:#FF9933" '>通过</a>
                                <a href="#" class="nopass" sid='<{$vo.sid}>' style="color:#FF9933" '>不通过</a>
                            </case>
                            <case value="1">
                                <a href="#" class="pass" sid='<{$vo.sid}>' style="color:#FF9933" '>通过</a>
                                <a href="#" class="nopass" sid='<{$vo.sid}>' style="color:#FF9933" '>不通过</a>
                            </case>
                            <case value="2">
                                 <a href="#" class="pass" sid='<{$vo.sid}>' style="color:#FF9933" '>通过</a>
                                <a href="#" class="nopass" sid='<{$vo.sid}>' style="color:#FF9933" '>不通过</a>
                            </case>
                            <default/>
                        </switch>
                    </td>
                </tr>
            </volist>
        </table>
        <div id="page">
            <{$page}>
        </div>
    </div>

    <script>
    $('.tophome').click(function(){
        var sid= ($(this).attr('sid'));
        $.ajax({
            type: "POST",
            url: "http://139.196.194.93:8080/smart/course/manger/updateCourseSite",
            data: {site:1,courseId:sid},
            success: function(data){
                if(data.code == 2000){
                    alert('推荐通过');
                    f5();
                }else{
                    alert('网络异常,请稍后再试');
                }
            }
        });
    });

     $('.notophome').click(function(){
        var sid= ($(this).attr('sid'));
        $.ajax({
            type: "POST",
            url: "http://139.196.194.93:8080/smart/course/manger/updateCourseSite",
            data: {site:0,courseId:sid},
            success: function(data){
                if(data.code == 2000){
                    alert('取消推荐');
                    f5();
                }else{
                    alert('网络异常,请稍后再试');
                }
            }
        });
    });
        $('.pass').click(function(){
            var sid= ($(this).attr('sid'));
            $.ajax({
                    type: "POST",
                    url: "http://139.196.194.93:8080/smart/course/manger/updateCourse",
                    data: {status:2,courseId:sid,comment:""},
                    success: function(data){
                      if(data.code == 2000){
                        alert('认证通过');
                        f5();
                    }else{
                        alert('网络异常,请稍后再试');
                    }
                }
            });
        });
        $('.nopass').click(function(){
            var sid= ($(this).attr('sid'));
            layer.prompt({title: '请输入备注', formType: 2}, function(comment, index){
                layer.close(index);
                $.ajax({
                    type: "POST", 
                    url: "http://139.196.194.93:8080/smart/course/manger/updateCourse",
                    data: {status:0,courseId:sid,comment:comment},
                    success: function(data){
                        if(data.code == 2000){
                            alert('认证不通过');
                            f5();
                        }else{
                            alert('网络异常,请稍后再试');
                        }
                    }
                });
            });
        });
    </script>

</body>
</html>
